Add upload support PG Dump files#102
Open
VineethReddy02 wants to merge 7 commits intotimescale:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive database restore functionality to the tiger CLI, enabling users to restore PostgreSQL/TimescaleDB databases from various dump formats. The implementation includes automatic format detection, TimescaleDB hook support, and cloud-friendly defaults.
Key Changes
- Added restore command (
tiger db restore) with support for multiple dump formats (plain SQL, custom, tar, directory) - Implemented preflight validation, connection management, and progress tracking
- Added TimescaleDB-specific pre/post restore hooks for optimal hypertable restoration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tiger/restore/restore.go | Core restore orchestration logic with workflow management |
| internal/tiger/restore/psql.go | Plain SQL restore using psql with statistics collection |
| internal/tiger/restore/pg_restore.go | Custom/tar/directory format restore using pg_restore |
| internal/tiger/restore/preflight.go | Pre-flight validation and service connectivity checks |
| internal/tiger/restore/format.go | Dump format detection from file content and extensions |
| internal/tiger/restore/timescaledb.go | TimescaleDB pre/post restore hook execution |
| internal/tiger/restore/util.go | Utility functions for formatting and error handling |
| internal/tiger/restore/confirm.go | User confirmation prompts for destructive operations |
| internal/tiger/restore/psql_test.go | Unit tests for formatting and pluralization functions |
| internal/tiger/cmd/db.go | CLI command definition with flags and documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Vineeth Pothulapati <vineethpothulapati@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Working example:
Detailed Upload CMD functionality: